#pragma once

#include "dut/WinMin.h"
#include "dut/DXTrace.h"
#include "dut/Texture.h"
#include "dut/Image.h"

using namespace Microsoft::WRL;

namespace Dut
{
	struct Texture2D : public Texture
	{

		struct Desc
		{
			int m_Width;
			int m_Height;
			bool m_Enbale4xMsaa = false;
			int m_MassQualityX4 = 0;

			unsigned char* m_Data= 0;
			DXGI_FORMAT m_Format = DXGI_FORMAT_R8G8B8A8_UNORM;
			UINT m_BindFlag = D3D11_BIND_SHADER_RESOURCE;

			bool m_CreateSrv = true;

			DXGI_FORMAT m_SrvFormat = DXGI_FORMAT_R8G8B8A8_UNORM;

		};
		HRESULT Create(ID3D11Device* device, const Desc& desc);
		HRESULT Create(ID3D11Device* device, const std::string& path);

		HRESULT ResizeBuffers(ID3D11Device* device, bool creatSrv = true);

	
	};

}